<jsp:directive.page contentType="text/html;charset=utf-8" />
<%@ include file="/taglibs.jsp" %>

<head>
<title>Catalogs</title>

<script type="text/javascript">
$(function() {
	$("#new" ).button();
	$("#new").click(function(){window.location='${ctx}/setup/catalog!editNew.action';});
});
$(document).ready(function(){
	jQuery("#list").jqGrid( {
		url : 'catalog!catalogJsonList.action',
		//search : {sopt : ['eq','ne']},
		jsonReader : {
			root : "rows", repeatitems : false, id : "0"},
		colNames : [ '<s:text name="module.common.id"/>', 
		 			 '<s:text name="module.common.name"/>',
		 			'<s:text name="module.common.nameEn"/>',
		 			 '<s:text name="module.common.description"/>',
		 			'<s:text name="module.common.isDeleted"/>'],
		colModel : [ {name : 'id',index : 'id', width : 120, 
							formatter:'showlink',formatoptions:{baseLinkUrl:'catalog!view.action',idName:'catalog.id'}},
		     		 {name : 'name',index : 'name',sortable : true,width : 120},
		     		 {name : 'nameEn',index : 'nameEn',sortable : true,width : 120},
		     		 {name : 'description',sortable : false, width : 280},
		     		 {name : 'isDeleted',sortable : false, width : 100}],
		shrinkToFit: true,
		rowNum : 15,
		rowList : [15,30,50],
		height: 'auto',
		pager : '#pager',
		sortname : 'id',
		viewrecords: true,
		sortorder : 'asc',
		loadOnce : true,
		caption : "Catalogs List",
		multiselect : true,
		editurl : 'catalog!jqgridOper.action'
	});
	jQuery("#list").jqGrid('navGrid',"#pager",{edit:false,add:false,del:true,search:false,refresh:true},
			{reloadAfterSubmit:false}, // edit options
			{reloadAfterSubmit:false}, // add options
			{reloadAfterSubmit:false}, // del options
			{sField : "jq.searchField", sFilter : "jq.searchFilter", sOper : "jq.searchOper", sValue : "jq.searchString"});//search options
	jQuery("#list").jqGrid('filterToolbar',{stringResult: true,searchOnEnter : false});

});
</script>
</head>


<body>
	<setion id="catalog">
	<div class="page-header">
		<h2>
		Catalogs: All Catalogs</h2>
	</div>
<button id="new" class="btn btn-primary"><s:text name="module.catalog.newCatalog"/></button>

<div>
<table id="list"></table>
<div id="pager"></div>
</div>



<script type="text/javascript">

</script>


</body>
